package com.kcsoft.mapper;

import com.kcsoft.pojo.Classes;
import com.kcsoft.pojo.Message;
import com.kcsoft.pojo.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TeacherMapper {

    @Insert("insert into dxai.classes (name, create_user, create_time, update_time) values " +
            "(#{name},#{userId},now(),now())")
    void makeClass(String name, Integer userId);


    @Delete("delete from dxai.classes where id=#{id}")
    void delClasses(Integer id);

    void addStus(List<Integer> ids, Integer classId);

    @Update("update dxai.assistant set value=#{value} where id=#{id}")
    void setModel(Integer id, Integer value);

    @Update("update dxai.user set password=#{password} where id=#{id}")
    void resetPwd(Integer id, String password);

    List<User> listUser(Integer classId, String stuId, Integer role);

    @Select("select * from dxai.classes where create_user=#{id}")
    List<Classes> listClasses(Integer id);

    List<Message> listMsg(Integer role);

    void delStus(List<Integer> ids);

    @Select("select * from dxai.user where class_id=#{classId}")
    List<User> listStus(Integer classId);

    void addUsers(List<User> users);
}
